perm filename TEX.UPD[WEB,ALS]2 blob
sn#673728 filedate 1982-08-17 generic text, type C, neo UTF8
COMMENT ⊗ VALID 00052 PAGES
C REC PAGE DESCRIPTION
C00001 00001
C00061 00002 This file is slightly newer than the latest hardcopy of TEX.WEB (which
C00067 00003 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1275 (57468)
C00079 00004
C00087 00005 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3278 (142955)
C00101 00006 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6079 (267294)
C00108 00007 ("Continue, and I'll forget that it ever happened.")
C00111 00008 if (cur←tok=par←token)andnon←long then @<Report a runaway argument and abort@>
C00114 00009 for m:=0 to n do flush←list(pstack[m])
C00116 00010
C00118 00011 if cur←val<>null then while r<>null do
C00120 00012 ***************
C00123 00013 begin j:=loc+1 buffer[last]:=" "
C00126 00014 different from the design size?}
C00128 00015 **** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9065 (392494)
C00131 00016
C00134 00017
C00137 00018 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10216 (446087)
C00139 00019 **** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10382 (452698)
C00141 00020 fonts, and that the text font in family@@3 has enough parameters to be a
C00144 00021 begin q:=char←info(f)(c) hd:=height←depth(q)
C00147 00022 @d mu←mult(#)==nx←plus←y(n,#,xn←over←d(#,f,@'200000))
C00150 00023 @!f:internal←font←number {its font}
C00152 00024 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12172 (530084)
C00154 00025 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12767 (555743)
C00156 00026 if mode=-vmode then
C00158 00027 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13200 (575027)
C00160 00028 print(": line ") print←int(line←number(q)-1)
C00162 00029 ***************
C00164 00030 ***************
C00166 00031
C00169 00032 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-14372 (627398)
C00172 00033 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16151 (703693)
C00175 00034 end←graf unsave output←active:=false@/
C00177 00035 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16662 (724123)
C00180 00036 might even say `\.{\\gdef\\end\{...\}}', to prolong the life of the job.)
C00183 00037 @d special←right==special←control←sequence+2 {permanent `\.{\\right}'}
C00185 00038 begin print←nl("! Illegal math \discretionary")
C00188 00039 ("you're probably due for more error messages, and you")@/
C00191 00040 help3("Sorry, but I can't go into math mode unless \textfont 3 and")@/
C00194 00041 end
C00196 00042 assign←toks: begin p:=cur←chr scan←optional←equals q:=scan←toks(false,false)
C00198 00043 if ((s=0)and(font←size[f]<>font←dsize[f]))or
C00200 00044 **** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19941 (845869)
C00203 00045 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19718 (835512)
C00205 00046 **** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20101 (848645)
C00207 00047 begin write←ln(err←file) a←close(err←file)
C00210 00048 print←ln print←int(hyph←count) print(" hyphenation exception")
C00213 00049 print("b,") print←int(save←size) print←char("s")
C00215 00050 **** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20678 (872184)
C00218 00051 end
C00220 00052 if send←open[j] then offset:=old←offset
C00223 ENDMK
C⊗;
This file is slightly newer than the latest hardcopy of TEX.WEB (which
was handed out at the Summer 82 TUG meeting at Stanford). The error
file is now called the transcript file, and its default extension is
".LOG" instead of ".ERR". Instead of "\minus" we have "\minusthe".
Calls to |scan←dimen(false,false,false)| are now |scan←normal←dimen|,
likewise |scan←glue(false)| calls are now |scan←normal←glue|; Here now
are a list of the changes in TEX.WEB, not including those just
mentioned. Minor errors that only affect the printed document, but
not its content, are also not shown. Finally, changes that only make
small differences in the information in the log file may not be shown.
After all the changes comes the new TEX.WEB file.
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-125 (6433)
@d banner=='This is TeX, Version -0.25' {printed when \TeX\ starts}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-125 (6435)
@d banner=='This is TeX, Version -0' {printed when \TeX\ starts}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-328 (16678)
@!pool←size=30000; {maximum number of characters in strings, including all
error messages and help texts, and the names of all fonts and
control sequences; must be at least 22000 more than |string←vacancies|}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-328 (16677)
@!pool←size=31000; {maximum number of characters in strings, including all
error messages and help texts, and the names of all fonts and
control sequences; must exceed |string←vacancies| by the total
length of \TeX's own strings, which is currently about 22000}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-869 (40169)
@ Here is how to open the terminal files in \ph:
@↑system dependencies@>
@d t←open←in==reset(term←in,'TTY:','/O') {open the terminal for text input}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-870 (40224)
@ Here is how to open the terminal files in \ph. The `\.{/I}' switch
suppresses the first |get|.
@↑system dependencies@>
@d t←open←in==reset(term←in,'TTY:','/O/I') {open the terminal for text input}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-930 (43369)
before a non-blank line comes in. The prompt is `\.\#' instead of the
later `\.*' because the meaning is slightly different: `\\input' need
not be typed immediately after `\.\#'.)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-932 (43469)
before a non-blank line comes in. The prompt is `\.{**}' instead of the
later `\.*' because the meaning is slightly different: `\.{\\input}' need
not be typed immediately after@@`\.{**}'.)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1035 (48266)
@d str←room(#) == begin if pool←ptr+# > pool←size then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1038 (48380)
@d str←room(#) == {make sure that the pool hasn't overflowed}
begin if pool←ptr+# > pool←size then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1268 (57124)
@!offset : 0..max←print←line; {the number of characters on the current line}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1274 (57386)
@!term←offset : 0..max←print←line;
{the number of characters on the current terminal line}
@!file←offset : 0..max←print←line;
{the number of characters on the current file line}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1275 (57468)
selector:=term←only; tally:=0; offset:=0;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1284 (57838)
selector:=term←only; tally:=0; term←offset:=0; file←offset:=0;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1281 (57634)
label exit;
begin case selector of
term←and←err: begin write←ln(term←out); write←ln(err←file);
end;
err←only: write←ln(err←file);
term←only: write←ln(term←out);
no←print: do←nothing;
pseudo,new←string: return;
othercases write←ln(send←file[selector])
endcases;@/
offset:=0; {|tally| is not affected}
exit:end;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1290 (58025)
begin case selector of
term←and←log: begin write←ln(term←out); write←ln(log←file);
term←offset:=0; file←offset:=0;
end;
log←only: begin write←ln(log←file); file←offset:=0;
end;
term←only: begin write←ln(term←out); term←offset:=0;
end;
no←print,pseudo,new←string: do←nothing;
othercases write←ln(send←file[selector])
endcases;@/
end; {|tally| is not affected}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1298 (58185)
@d preserve←offset=90 {go here when |offset| is not to be changed}
@<Basic printing...@>=
procedure print←char(@!c:ascii←code); {prints a single character}
label preserve←offset;
begin case selector of
term←and←err: begin write(term←out,xchr[c]); write(err←file,xchr[c]); end;
err←only: write(err←file,xchr[c]);
term←only: write(term←out,xchr[c]);
no←print: do←nothing;
pseudo: begin if tally<trick←count then
trick←buf[tally mod error←line]:=c;
goto preserve←offset;
end;
new←string: begin if pool←ptr<pool←size then append←char(c);
goto preserve←offset; {drop characters if the string space is full}
end;
othercases begin write(send←file[selector],xchr[c]); goto preserve←offset;
end
endcases;@/
incr(offset);
if offset=max←print←line then print←ln;
preserve←offset:incr(tally);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1307 (58631)
@<Basic printing...@>=
procedure print←char(@!c:ascii←code); {prints a single character}
begin case selector of
term←and←log: begin write(term←out,xchr[c]); write(log←file,xchr[c]);
incr(term←offset); incr(file←offset);
if term←offset=max←print←line then
begin write←ln(term←out); term←offset:=0;
end;
if file←offset=max←print←line then
begin write←ln(log←file); file←offset:=0;
end;
end;
log←only: begin write(log←file,xchr[c]); incr(file←offset);
if file←offset=max←print←line then print←ln;
end;
term←only: begin write(term←out,xchr[c]); incr(term←offset);
if term←offset=max←print←line then print←ln;
end;
no←print: do←nothing;
pseudo: if tally<trick←count then trick←buf[tally mod error←line]:=c;
new←string: begin if pool←ptr<pool←size then append←char(c);
end; {drop characters if the string space is full}
othercases write(send←file[selector],xchr[c])
endcases;@/
incr(tally);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1332 (59492)
begin if (s<0)or(s>=str←ptr) then s:=0; {this can't happen}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1343 (60063)
begin if (s<0)or(s>=str←ptr) then s:="↑↑!"; {this can't happen}
@.\↑\↑!@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1340 (59735)
the version number and format package. The |offset| variable is temporarily
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1352 (60321)
the version number and format package. The |term←offset| variable is temporarily
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1356 (60383)
begin if offset>0 then print←ln;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1368 (60974)
begin if ((term←offset>0)and(odd(selector)))or@|
((file←offset>0)and(selector>=log←only)) then print←ln;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1472 (64268)
if not input←ln(term←in) then fatal←error("! End of file on the terminal");
@.End of file on the terminal...@>
decr(selector); {prepare to echo the input}
if last<>first then for k:=first to last-1 do print(buffer[k]);
print←ln; incr(selector); {restore previous status, with |offset=0|}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1485 (64934)
if not input←ln(term←in) then fatal←error("End of file on the terminal!");
@.End of file on the terminal@>
term←offset:=0; {the user's line ended with carriage return}
decr(selector); {prepare to echo the input}
if last<>first then for k:=first to last-1 do print(buffer[k]);
print←ln; incr(selector); {restore previous status}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1613 (70321)
@!s1,@!s2,@!s3:integer; {used to save global variables when deleting tokens}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1627 (71028)
@!s1,@!s2,@!s3,@!s4:integer;
{used to save global variables when deleting tokens}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1636 (71201)
wizardry, so it is not standard in \TeX\ and not included here except
as a recommendation. (The name of the file to edit, if an `\.E' option is
added, is |input←stack[base←ptr].name←field|, provided that |base←ptr>0|;
the value of |base←ptr| has been set by |show←context|.
No input files are open when |base←ptr=0|.)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1652 (71923)
wizardry, so the present implementation simply types out what file should be
edited and the relevant line number.
"E": if base←ptr>0 then
begin print←nl("You want to edit file ");
@.You want to edit file x@>
print(input←stack[base←ptr].name←field);
print(" at line "); print←int(line);
interaction:=scroll←mode; quit;
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1664 (72346)
@ The `\.E' option in the following menu
should be taken out of braces if it is implemented.
@↑system dependencies@>
@<Print the menu...@>=
print("Type <return> to proceed, S to scroll future error messages,");@/
print←nl("R to run without stopping, Q to run quietly,");@/
print←nl("I to insert something, ");@/
@{@,@,@+if base←ptr>0 then print("E to edit your file,");@;@+@}@/
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1685 (73113)
@ @<Print the menu...@>=
print("Type <return> to proceed, S to scroll future error messages,");@/
print←nl("R to run without stopping, Q to run quietly,");@/
print←nl("I to insert something, ");
if base←ptr>0 then print("E to edit your file,");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1699 (73758)
else begin prompt←input("**"); loc:=first;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1716 (74387)
else begin prompt←input("insert>"); loc:=first;
@.insert>@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1709 (73995)
begin s1:=cur←tok; s2:=cur←cmd; s3:=cur←chr; OK←to←interrupt:=false;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1727 (74642)
begin s1:=cur←tok; s2:=cur←cmd; s3:=cur←chr; s3:=align←state;
align←state:=1000000; OK←to←interrupt:=false;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1717 (74295)
cur←tok:=s1; cur←cmd:=s2; cur←chr:=s3; OK←to←interrupt:=true;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1736 (74982)
cur←tok:=s1; cur←cmd:=s2; cur←chr:=s3; align←state:=s4; OK←to←interrupt:=true;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1756 (75732)
error; quit; {irrecoverable error}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1775 (76436)
error;
debug if interaction>batch←mode then debug←help;@+gubed
quit; {irrecoverable error}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-1785 (76642)
begin if spotless then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-1806 (77408)
begin selector:=term←and←log; {the transcript file is already open}
if spotless then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2042 (87512)
arithmetic; see {\sl TUGboat \bf3} (1982), 10--27.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2064 (88341)
arithmetic; see {\sl TUGboat \bf3},1 (February 1982), 10--27.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2223 (95978)
report these statistics whenever a page is output and |tracing←stats| is
nonzero.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2245 (96818)
report these statistics when |tracing←stats| is sufficiently large.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2511 (109198)
@d glue←set(#) == mem[#+6].gr {a word of type |glue←ratio| for glue setting}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2532 (110031)
@d glue←offset = 6 {position of |glue←set| in a box node}
@d glue←set(#) == mem[#+glue←offset].gr
{a word of type |glue←ratio| for glue setting}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2709 (119239)
@d mu←glue=98 {|subtype| for mskip glue}
@d cond←math←glue=99 {special |subtype| to suppress glue in the next node}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2732 (120144)
@d cond←math←glue=98 {special |subtype| to suppress glue in the next node}
@d mu←glue=99 {|subtype| for mskip glue}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2850 (125626)
@d glue←stretch(#)==mem[#+6].sc {total stretch in an unset node}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2873 (126531)
@d glue←stretch(#)==mem[#+glue←offset].sc {total stretch in an unset node}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2875 (127103)
through |mem←max|, inclusive.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2898 (128018)
through |mem←max|, inclusive. It is harmless to let |lig←trick|, |garbage|,
and |backup←head| share the same location of |mem|.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-2890 (127942)
@d scan←head==hi←mem←base+5 {head of token list built by |scan←keyword|}
@d adjust←head==hi←mem←base+6 {head of adjustment list returned by |hpack|}
@d active==hi←mem←base+7 {head of active list in |line←break|, needs two words}
@d align←head==hi←mem←base+9 {head of preamble list for alignments}
@d end←span==hi←mem←base+10 {tail of spanned-width lists}
@d omit←template==hi←mem←base+11 {a constant token list}
@d lig←trick==hi←mem←base+12 {a ligature masquerading as a |char←node|}
@d garbage==hi←mem←base+13 {used for scrap information}
@d second←mem==hi←mem←base+14 {first dynamically allocatable word in
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-2914 (128956)
@d adjust←head==hi←mem←base+5 {head of adjustment list returned by |hpack|}
@d active==hi←mem←base+6 {head of active list in |line←break|, needs two words}
@d align←head==hi←mem←base+8 {head of preamble list for alignments}
@d end←span==hi←mem←base+9 {tail of spanned-width lists}
@d omit←template==hi←mem←base+10 {a constant token list}
@d lig←trick==hi←mem←base+11 {a ligature masquerading as a |char←node|}
@d garbage==hi←mem←base+11 {used for scrap information}
@d backup←head==hi←mem←base+11 {head of token list built by |scan←keyword|}
@d second←mem==hi←mem←base+12 {first dynamically allocatable word in
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3278 (142955)
a structured type instead of an ordinary |real|.
@<Display the value of |glue←set(p)|@>=
if glue←set(p)<>0 then
begin print(", glue set ");
if glue←sign(p)=shrinking then print("- ");
if abs(glue←set(p))>20000.0 then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3304 (143997)
a structured type instead of an ordinary |real|. Note that this routine
should avoid arithmetic errors even if the |glue←set| field holds an
arbitrary random value. The following code assumes that a properly
formed nonzero |real| number has absolute value $2↑{20}$ or more when
it is regarded as an integer; this precaution was adequate to prevent
floating point underflow on the author's computer.
@↑system dependencies@>
@<Display the value of |glue←set(p)|@>=
if (glue←set(p)<>0)and(glue←sign(p)<>normal) then
begin print(", glue set ");
if glue←sign(p)=shrinking then print("- ");
if abs(mem[p+glue←offset].int)<@'4000000 then print("0.0")
else if abs(glue←set(p))>20000.0 then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3310 (143999)
else if subtype(p)=cond←math←glue then print←esc("non←script")
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3343 (145515)
else if subtype(p)=cond←math←glue then print←esc("nonscript")
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3363 (145557)
if pre←break(p)=null then print(" (exhyphen)")
else node←list←display(pre←break(p)); {recursive call}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3396 (147072)
node←list←display(pre←break(p)); {recursive call}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3554 (153263)
``chcode'' commands, several of which are used also as ordinary commands
when the chcode cannot emerge from \TeX's scanning routine.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3586 (154741)
``chcode'' commands, several of which share their numeric codes with
ordinary commands when the chcode cannot emerge from \TeX's scanning routine.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3762 (163894)
calculations, or it is |<=1000|pt if the next box on the vertical list is to
be exempt from baseline calculations. In horizontal mode, |aux| is also
known as |space←factor|; it holds the current space factor use in spacing
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3794 (165386)
calculations, or it is |<=-1000|pt if the next box on the vertical list is to
be exempt from baseline calculations. In horizontal mode, |aux| is also
known as |space←factor|; it holds the current space factor used in spacing
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3858 (168356)
print←nl("");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3890 (169850)
print←nl(""); print←ln;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3875 (168995)
begin print(", already ");
print←int(nest[p].already←field);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-3907 (170499)
begin print(", prevgraf ");
print←int(nest[p].already←field); print(" lines");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-3974 (173529)
@d undefined←control←sequence=hash←base+hash←size+3 {dummy location}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4006 (175051)
@d undefined←control←sequence=hash←base+hash←size+4 {dummy location}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-4190 (183630)
halfword. This is what makes region@@5 different from region 4.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4222 (185152)
halfword. This is what makes region@@5 different from region@@4. We will
store the |eq←level| information in an auxiliary array of quarterwords
that will be defined later.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-4230 (185985)
@d hang←after←code=36 {hanging indentation changes after this many lines}
@d int←pars=37 {total number of integer parameters}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4264 (187617)
@d max←dead←cycles←code=36 {bound on consecutive dead cycles of output}
@d hang←after←code=37 {hanging indentation changes after this many lines}
@d int←pars=38 {total number of integer parameters}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-4275 (188107)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4310 (189812)
@d max←dead←cycles==int←par(max←dead←cycles←code)
max←dead←cycles←code:print←esc("maxdeadcycles");
primitive("maxdeadcycles",assign←int,max←dead←cycles←code);@/
@!@:max←dead←cycles←}{\.{\\maxdeadcycles} primitive@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-4413 (194672)
mag:=1000; tolerance:=10000;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4452 (196596)
mag:=1000; tolerance:=10000; max←dead←cycles:=25;
@ \TeX\ is occasionally supposed to print diagnostic information that
goes only into the transcript file, unless |tracing←online| is nonzero.
Here are two routines that adjust the destination of print commands:
@p procedure begin←diagnostic; {prepare to do some tracing}
begin old←setting:=selector;
if (tracing←online=0)and(selector=term←and←log) then decr(selector);
end;
@#
procedure end←diagnostic(@!blank←line:boolean);
{restore proper conditions after tracing}
begin print←nl("");
if blank←line then print←ln;
selector:=old←setting;
end;
@ Of course we had better declare another global variable, if the previous
routines are going to work.
@<Glob...@>=
@!old←setting:0..max←selector;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-4566 (201511)
@ \TeX\ is occasionally supposed to print diagnostic information that
goes only into the transcript file, unless |tracing←online| is nonzero.
Here are two routines that adjust the destination of print commands:
@p procedure begin←diagnostic; {prepare to do some tracing}
begin old←setting:=selector; save←offset:=offset;
if (tracing←online=0)and(selector=term←and←err) then decr(selector);
end;
@#
procedure end←diagnostic; {restore proper conditions after tracing}
begin if offset>0 then print←ln;
selector:=old←setting;
if (tracing←online=0)and(old←setting=term←and←err) then offset:=save←offset;
end;
@ Of course we had better declare two more global variables, if the previous
routines are going to work.
@<Glob...@>=
@!old←setting:0..max←selector;
@!save←offset:0..max←print←line;
table, it is never removed again, because there are complicated situations
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-4631 (204442)
table, it is never removed, because there are complicated situations
@d tab←token=@'2000 {$2↑8\cdot|tab←mark|$}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-5243 (230887)
|letter|\,\.{\\b}, |end←match|,\cr
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-5285 (232821)
\.{\\b}, |end←match|,\cr
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-5600 (247721)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-5646 (249702)
@!def←ref : pointer; {reference count of token list being defined}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-5609 (248063)
defining: begin print("definition?"); p:=temp←head;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-5657 (250114)
defining: begin print("definition?"); p:=def←ref;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-5769 (254805)
if base←ptr=0 then print←nl("<*>") else print←nl("<**>")
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-5817 (256854)
if base←ptr=0 then print←nl("<*>") else print←nl("<insert> ")
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-5946 (262065)
begin p:=get←avail; info(p):=cur←tok;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-5994 (264119)
begin while (state=token←list)and(loc=null) do
end←token←list; {conserve stack space}
p:=get←avail; info(p):=cur←tok;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6049 (266074)
begin if scanner←status<>normal then
if scanner←status>skipping then @<Tell the user what has run away@>
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6099 (268212)
@!q:pointer; {auxiliary pointer}
begin if scanner←status<>normal then
if scanner←status>skipping then
@<Tell the user what has run away and try to recover@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6060 (266516)
@ @<Tell the user what has run away@>=
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6112 (268712)
@ @<Tell the user what has run away...@>=
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6071 (267003)
case scanner←status of
defining:print("definition");
matching:print("use");
aligning:print("preamble");
end; {there are no other cases}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6123 (269202)
@<Print either `\.{definition}' or `\.{use}' or `\.{preamble}', and
insert tokens that should lead to recovery@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6079 (267294)
("Either type `I}' to try recovering,")@/
("or type 'X' and fix your file.");@/
deletions←allowed:=false; error; deletions←allowed:=true;
end
@ We need to mention two procedures here that may be called by |get←next|.
@p procedure@?open←err←file; forward;@t\2@>
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6128 (269470)
("I'll try to recover; but if the error is serious,")@/
("you'd better type `E' or `X' now and fix your file.");@/
deletions←allowed:=false; error; deletions←allowed:=true;
end
@ The recovery procedure can't be fully understood without knowing more
about the \TeX\ routines that should be aborted, but we can sketch the
ideas here: For a runaway definition we will insert a right brace; for a
runaway preamble, we will insert a special \.{\\cr} token and a right
brace; and for a runaway argument, we will set |long←state| to
|outer←call| and insert \.{\\par}.
@d special←cr==special←control←sequence
@d special←cr←token==cs←token←flag+special←cr
@<Print either `\.{definition}' or ...@>=
p:=get←avail;
case scanner←status of
defining:begin print("definition"); info(p):=right←brace←token+"}";
end;
matching:begin print("use"); info(p):=par←token; long←state:=outer←call;
end;
aligning:begin print("preamble"); info(p):=right←brace←token+"}"; q:=p;
p:=get←avail; link(p):=q; info(p):=special←cr←token;
end;
end; {there are no other cases}
ins←list(p)
@ We need to mention two procedures here that may be called by |get←next|.
@p procedure@?open←log←file; forward;@t\2@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6166 (270817)
("Continue, and I'll forget that it ever happened.");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6238 (273937)
("Continue, and I'll forget that it ever happened.");@/
deletions←allowed:=false; error; deletions←allowed:=true;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6534 (285569)
The parameters, if any, must be scanned before the macro is expanded.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6609 (288765)
The global variable |long←state| will be set to |call| or to |long←call|,
depending on whether or not the control sequence disallows \.{\\par}
in its parameters. The |get←next| routine will set |long←state| to
|outer←call| and emit \.{\\par}, if a file ends or if an \.{\\outer}
control sequence occurs in the midst of an argument.
@<Glob...@>=
@!long←state:call..long←outer←call; {governs the acceptance of \.{\\par}}
@ The parameters, if any, must be scanned before the macro is expanded.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6572 (287647)
@!non←long:boolean; {is \.{\\par} forbidden in parameters?}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6656 (291275)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6622 (290108)
if (eq←type(cs←ptr)=call)or(eq←type(cs←ptr)=outer←call) then non←long:=true
else non←long:=false;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6705 (293675)
long←state:=eq←type(cs←ptr);
if long←state>=outer←call then long←state:=long←state-2;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6646 (291333)
if (cur←tok=par←token)andnon←long then @<Report a runaway argument and abort@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6729 (294888)
if (cur←tok=par←token)and(long←state<>long←call) then
@<Report a runaway argument and abort@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6671 (292422)
begin print←nl("Argument of "); sprint←cs(warning←index);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6755 (295995)
begin print←nl("! Argument of "); sprint←cs(warning←index);
@.Argument of \\x has...@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6678 (292843)
incr(align←state); non←long:=true; error;
end
@ @<Report a runaway argument and abort@>=
begin runaway; print←nl("! Paragraph ended before "); sprint←cs(warning←index);
@.Paragraph ended before...@>
print(" was complete");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6763 (296446)
incr(align←state); long←state:=call; error;
end
@ If |long←state=outer←call|, a runaway argument has already been reported.
@<Report a runaway argument and abort@>=
begin if long←state=call then
begin runaway; print←nl("! Paragraph ended before ");
@.Paragraph ended before...@>
sprint←cs(warning←index); print(" was complete");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6688 (293277)
pstack[n]:=link(temp←head); align←state:=align←state-unbalance;
for m:=0 to n do flush←list(pstack[m]);
back←error; return;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6776 (297000)
back←error;
end;
pstack[n]:=link(temp←head); align←state:=align←state-unbalance;
for m:=0 to n do flush←list(pstack[m]);
return;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6739 (295421)
if (cur←tok=par←token)and non←long then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6829 (299155)
if (cur←tok=par←token)and(long←state<>long←call) then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6763 (296323)
end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6853 (300071)
end←diagnostic(false);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6769 (296467)
token←show(ref←count); end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6859 (300222)
token←show(ref←count); end←diagnostic(false);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6855 (299747)
begin p:=scan←head; link(p):=null; k:=str←start[s];
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6945 (303509)
begin p:=backup←head; link(p):=null; k:=str←start[s];
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6863 (300023)
if p<>scan←head then ins←list(link(scan←head));
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6953 (303787)
if p<>backup←head then ins←list(link(backup←head));
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-6867 (300128)
flush←list(link(scan←head)); scan←keyword:=true;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-6957 (303896)
flush←list(link(backup←head)); scan←keyword:=true;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7314 (318336)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7403 (322126)
@d scan←normal←dimen==scan←dimen(false,false,false)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7372 (320746)
done: f:=round←decimals(k); back←input;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7463 (324594)
done: f:=round←decimals(k);
if cur←cmd<>spacer then back←input;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7501 (326136)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7593 (330009)
@d scan←normal←glue==scan←glue(false)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7628 (331091)
while r<>null do
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7721 (334973)
if cur←val<>null then while r<>null do
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7673 (333122)
var r: pointer; {reference count location}
@!t:halfword; {token representing the highest parameter number}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7766 (337029)
var t:halfword; {token representing the highest parameter number}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7680 (333497)
begin scanner←status:=defining; warning←index:=cs←ptr; r:=get←avail; info(r):=0;
p:=r; hash←brace:=0;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7772 (337362)
begin scanner←status:=defining; warning←index:=cs←ptr;
def←ref:=get←avail; info(def←ref):=0;
p:=def←ref; hash←brace:=0; t:=zero←token;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7687 (333928)
cur←val:=r; scan←toks:=p;
end;
@ @<Scan and build the parameter part...@>=
begin t:=zero←token; {this represents |"0"|}
loop@+ begin get←token; {set |cur←cmd|, |cur←chr|, |cur←tok|}
if cur←cmd<=right←brace then goto done1;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7780 (337827)
scan←toks:=p;
end;
@ @<Scan and build the parameter part...@>=
begin loop
begin get←token; {set |cur←cmd|, |cur←chr|, |cur←tok|}
if cur←tok<right←brace←limit then goto done1;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7697 (334315)
`|left←brace|, |end←match|' and |goto done|@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7790 (338167)
`|left←brace|, |end←match|', set |hash←brace|, and |goto done|@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7715 (334940)
begin store←new←token(cur←tok); store←new←token(end←match←token);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7808 (338811)
begin hash←brace:=cur←tok;
store←new←token(cur←tok); store←new←token(end←match←token);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7739 (335736)
if cur←cmd<=right←brace then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-7833 (339631)
if cur←tok<right←brace←limit then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7976 (345938)
the preliminary initialization. The buffer contains the first line of input
in |buffer[loc..(last-1)]|, where |loc<last| and |buffer[loc]<>" "|.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8070 (349832)
the preliminary initialization, or when the user is substituting another
format file by typing `\.!' after the initial `\.{**}' prompt. The buffer
contains the first line of input in |buffer[loc..(last-1)]|, where
|loc<last| and |buffer[loc]<>" "|.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7983 (346247)
begin if buffer[loc]<>"\" then
begin j:=loc+1; buffer[last]:=" ";
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8079 (350248)
begin if buffer[loc]="!" then
begin incr(loc); j:=loc; buffer[last]:=" ";
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-7995 (346666)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8091 (350677)
write←ln(term←out,'Sorry, I can''t find that format; will try BASIC.');
@.Sorry, I can't find...@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8138 (351996)
input←stack[input←ptr]:=cur←input; {make sure bottom level is in memory}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8239 (356197)
input←stack[input←ptr]:=cur←input; {make sure bottom level is in memory}
print←nl("**");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8160 (352895)
print←char("0"+(time mod 10)); print←ln;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8262 (357109)
print←char("0"+(time mod 10));
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8307 (360007)
of |param[6]|, one \.{em} or \.{\\quad}, is often the |fix←word| value
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8409 (364220)
of |param[6]|, which defines the \.{em} unit, is often the |fix←word| value
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8485 (368708)
@!font←scaled:array[internal←font←number] of boolean; {is the ``at'' size
different from the design size?}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8587 (372926)
@!font←dsize:array[internal←font←number] of scaled; {``design'' size}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8696 (378347)
if not b←open←in(tfm←file) then goto bad←tfm;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8797 (382525)
if not b←open←in(tfm←file) then abort;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8781 (381325)
if s=0 then font←scaled[f]:=false
else if z=s then font←scaled[f]:=false
else begin font←scaled[f]:=true; z:=s;
end;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-8882 (385496)
font←dsize[f]:=z;
if s<>0 then z:=s;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8966 (388408)
begin help2("To increase the number of font parameters, you must")@/
("use \texinfo immediately after the font code is defined.");
print←nl("! Font "); print←int(font←code[f]);
@.Font x has n texinfo...@>
print(" has "); print←int(font←params[f]);
print(" texinfo parameters"); error;
end
@ @<Increase the number of parameters...@>=
repeat if fmem←ptr=font←mem←size then overflow("font memory",font←mem←size);
font←info[fmem←ptr].sc:=0; incr(fmem←ptr); incr(font←params[f]);
until cur←val=font←params[f]
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9065 (392494)
begin print←nl("! Font "); print←int(font←code[f]);
print(" has "); print←int(font←params[f]);
print(" texinfo parameters");
@.Font x has n texinfo...@>
help2("To increase the number of font parameters, you must")@/
("use \texinfo immediately after the font code is defined.");
error;
end
@ @<Increase the number of parameters...@>=
begin repeat if fmem←ptr=font←mem←size then
overflow("font memory",font←mem←size);
font←info[fmem←ptr].sc:=0; incr(fmem←ptr); incr(font←params[f]);
until cur←val=font←params[f];
cur←val:=fmem←ptr-1; {this equals |param←base[f]+font←params[f]|}
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-8990 (389448)
print(font←name[f]); print←char("!"); end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9093 (393619)
print(font←name[f]); print←char("!"); end←diagnostic(false);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9285 (404213)
\yskip\hang|xxx| 239 |m[1]| |x[m]|. This command is undefined in
general; it functions as an $(m+2)$-byte |nop| unless special \.{DVI}-reading
programs are being used. \TeX82 generates this command when an \.{\\xsend}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9388 (408391)
\yskip\hang|xxx1| 239 |m[1]| |x[m]|. This command is undefined in
general; it functions as an $(m+2)$-byte |nop| unless special \.{DVI}-reading
programs are being used. \TeX82 generates |xxx1| when an \.{\\xsend}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9292 (404621)
\yskip\hang|pst| 240. Beginning of the postamble, see below.
\yskip\noindent Commands 241--255 are undefined at the present time.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9395 (408794)
\yskip\hang|xxx2| 240 |m[2]| |x[m]|. Like |xxx1|, but |0<=m<65536|.
\yskip\hang|xxx3| 241 |m[2]| |x[m]|. Like |xxx1|, but |0<=m<@t$2↑{24}$@>|.
\yskip\hang|xxx4| 242 |m[2]| |x[m]|. Like |xxx1|, but |m| can be ridiculously
large.
\yskip\hang|pst| 243. Beginning of the postamble, see below.
\yskip\noindent Commands 244--255 are undefined at the present time.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9318 (405544)
@d xxx=239 {extension to \.{DVI} primitives}
@d pst=240 {postamble}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9428 (409955)
@d xxx1=239 {extension to \.{DVI} primitives}
@d xxx4=242 {potentially long extension to \.{DVI} primitives}
@d pst=243 {postamble}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9371 (408669)
The postamble continues with font definitions, which are any number of
speci\-fi\-ca\-tions having the form
\def\f{←{\!f}}
$$\hbox{|f[4]| $c\f[4]$ $s\f[4]$ $a\f[1]$ $l\f[1]$ $n\f[a\f+l\f]$.}$$
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9482 (413145)
@ The postamble continues with font definitions, which are any number of
speci\-fi\-ca\-tions having the form
\def\f{←{\!f}}
$$\hbox{|f[4]| $c\f[4]$ $s\f[4]$ $d\f[4]$ $a\f[1]$ $l\f[1]$ $n\f[a\f+l\f]$.}$$
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9388 (409740)
file, i.e., in sp.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9500 (414229)
file, i.e., in sp when |n| and |d| have the values stated above.
Parameter $d\f$ is similar to $s\f$; it is the ``design size,'' and it is
given in \.{DVI} units that have not been corrected for the magnification@@|m|.
Thus, font |f| is to be used at $ms\f/1000d/f$ times its normal size.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9417 (411466)
contain the value 240 (|pst|); now the postamble can be read, so the
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9532 (416228)
contain the value 243 (|pst|); now the postamble can be read, so the
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9469 (414236)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9583 (418996)
The variable |dead←cycles| contains the number of times an output routine
has been initiated since the last |ship←out|.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9481 (414891)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9598 (419775)
@!dead←cycles:integer; {recent outputs that didn't ship anything out}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-9491 (415354)
doing←leaders:=false;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-9609 (420309)
doing←leaders:=false; dead←cycles:=0;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10216 (446087)
begin if offset>max←print←line-9 then print←ln@+else print←char(" ");
print←char("["); print←int(count(0)); update←terminal;
end
else begin print←nl(""); print←nl("Completed box being shipped out [");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10337 (451190)
begin if term←offset>max←print←line-9 then print←ln@+else print←char(" ");
print←char("["); print←int(count(0)); update←terminal;
end
else begin print←nl(""); print←ln;
print("Completed box being shipped out [");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10226 (446439)
begin←diagnostic; show←box(p); end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10348 (451557)
begin←diagnostic; show←box(p); end←diagnostic(true);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10234 (446738)
stat if tracing←stats<>0 then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10356 (451862)
stat if tracing←stats>1 then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10241 (446932)
stat if tracing←stats<>0 then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10363 (452055)
stat if tracing←stats>1 then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10260 (447576)
dvi←out(eop); incr(total←pages)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10382 (452698)
dvi←out(eop); incr(total←pages); dead←cycles:=0
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10297 (449162)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10419 (454300)
dvi←four(font←dsize[font←ptr]);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10563 (460367)
begin←diagnostic; show←box(r); end←diagnostic
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10688 (465574)
begin←diagnostic; show←box(r); end←diagnostic(true)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-10708 (465715)
begin←diagnostic; show←box(r); end←diagnostic
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-10837 (471014)
begin←diagnostic; show←box(r); end←diagnostic(true)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11012 (481138)
ord←noad,op←noad,bin←noad,rel←noad,open←noad,close←noad,punct←noad,
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11143 (486483)
ord←noad,op←noad,bin←noad,rel←noad,open←noad,close←noad,punct←noad,inner←noad,
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11095 (484475)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11226 (489831)
inner←noad: print←esc("subformula");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11156 (486970)
fonts, and that the text font in family@@3 has enough parameters to be a
math-extension font. The math-symbol parameters are referred to by using the
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11288 (492364)
fonts, and that the fonts in family@@3 have enough parameters to be
math-extension fonts. The math-symbol parameters are referred to by using the
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11216 (490223)
cur←mu:=x←over←n(math←quad(cur←style),18);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11348 (495613)
cur←mu:=x←over←n(math←quad(cur←size),18);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11307 (494284)
begin if char←tag(q)=ext←tag then goto found;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11439 (499673)
begin if char←tag(q)=ext←tag then
begin f:=g; c:=y; goto found;
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11321 (494616)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11455 (500042)
@ Here is a subroutine that creates a new box, whose contents is a
single character, and whose width includes the italic correction for
that character. The height or depth of the box will be negative, if
the height or depth of the character is negative; thus, this routine
may deliver a slightly different result than |hpack| would produce.
@<Declare subprocedures for |var←delimiter|@>=
function char←box(@!f:internal←font←number;@!c:quarterword):pointer;
var q:four←quarters;
@!hd:eight←bits; {|height←depth| byte}
@!b,@!p:pointer; {the new box and its character node}
begin q:=char←info(f)(c); hd:=height←depth(q);
b:=new←null←box; width(b):=char←width(f)(q)+char←italic(f)(q);
height(b):=char←height(f)(hd); depth(b):=char←height(f)(hd);
p:=get←avail; character(p):=c; font(p):=f; list←ptr(b):=p; char←box:=b;
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11326 (494841)
@<Construct an extensible character for |(f,c)| in box |b|@>
else begin p:=get←avail; font(p):=f; character(p):=c; list←ptr(b):=p;
b:=hpack(p,natural);
end
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11477 (501105)
@<Construct an extensible character in a new box |b|,
using recipe |rem←byte(q)| and font |f|@>
else b:=char←box(f,c)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11339 (495351)
begin p:=get←avail; font(p):=f; character(p):=c; p:=hpack(p,natural);
link(p):=list←ptr(b); list←ptr(b):=p;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11489 (501575)
begin p:=char←box(f,c); link(p):=list←ptr(b); list←ptr(b):=p;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11382 (496851)
w:=0; width(b):=char←width(f)(char←info(f)(c));@/
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11531 (503028)
w:=0; q:=char←info(f)(c); width(b):=char←width(f)(q)+char←italic(f)(q);@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11417 (498279)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11566 (504480)
@d mu←mult(#)==nx←plus←y(n,#,xn←over←d(#,f,@'200000))
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11423 (498530)
width(p):=nx←plus←y(n,width(g),f); {convert \.{mu} to \.{pt}}
stretch←order(p):=stretch←order(g);
if stretch←order(p)=normal then stretch(p):=nx←plus←y(n,stretch(g),f)
else stretch(p):=stretch(g);
shrink←order(p):=shrink←order(g);
if shrink←order(p)=normal then shrink(p):=nx←plus←y(n,shrink(g),f)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11574 (504788)
width(p):=mu←mult(width(g)); {convert \.{mu} to \.{pt}}
stretch←order(p):=stretch←order(g);
if stretch←order(p)=normal then stretch(p):=mu←mult(stretch(g))
else stretch(p):=stretch(g);
shrink←order(p):=shrink←order(g);
if shrink←order(p)=normal then shrink(p):=mu←mult(shrink(g))
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11441 (499197)
width(p):=nx←plus←y(n,width(p),f); subtype(p):=normal;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11592 (505437)
width(p):=mu←mult(width(p)); subtype(p):=normal;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11661 (508873)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11812 (515117)
subtype(q):=normal;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11757 (512663)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11909 (518938)
@!c:quarterword; {accent character}
@!f:internal←font←number; {its font}
@!i:four←quarters; {its |char←info|}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11760 (512766)
begin x:=clean←box(operand(q),und←style(cur←style));
@<Switch to a larger accent if available and appropriate@>;
delta:=height(x)-x←height(cur←f);
if delta<0 then delta:=0;
y:=hpack(new←character(cur←f,cur←c),natural);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11915 (519154)
begin i:=cur←i; c:=cur←c; f:=cur←f;@/
x:=clean←box(operand(q),und←style(cur←style));
@<Switch to a larger accent if available and appropriate@>;
delta:=height(x)-x←height(f);
if delta<0 then delta:=0;
y:=char←box(f,c);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-11774 (513297)
loop@+ begin if char←tag(cur←i)<>list←tag then goto done;
y:=rem←byte(cur←i);
cur←i:=char←info(cur←f)(y);
if char←width(cur←f)(cur←i)>width(x) then goto done;
cur←c:=y;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-11930 (519688)
loop@+ begin if char←tag(i)<>list←tag then goto done;
y:=rem←byte(i);
i:=char←info(f)(y);
if char←width(f)(i)>width(x) then goto done;
c:=y;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12172 (530084)
glue←node,kern←node: begin@t@>@;@/
link(p):=q; q:=link(q); link(p):=null; goto done;
end;
othercases confusion("mlist3")
@:confusion mlist3}{\quad mlist3@>
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12328 (536481)
glue←node,kern←node:@;@/
begin link(p):=q; p:=q; q:=link(q); link(p):=null; goto done;
end;
othercases confusion("mlist3")
@:this can't happen mlist3}{\quad mlist3@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12502 (545248)
else begin if mode>0 then mode:=-mode;
if mode=-hmode then space←factor:=1000;
end
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12658 (551663)
else if mode>0 then mode:=-mode
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12565 (548115)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12718 (554472)
text(special←cr):="cr"; eqtb[special←cr]:=eqtb[cur←val];
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12614 (549899)
if (cur←cmd<=car←ret)and(cur←cmd>=tab←mark)and(align←state=-1000000) then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12769 (556316)
if (cur←cmd<=car←ret)and(cur←cmd>=tab←mark)and(align←state=-999999) then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12767 (555743)
begin u:=hpack(head,natural); w:=width(u);
end
else begin u:=vpackage(head,natural,0); w:=height(u);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12922 (562167)
begin u:=hpack(link(head),natural); w:=width(u);
end
else begin u:=vpackage(link(head),natural,0); w:=height(u);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12799 (557114)
q:=cur←span;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12954 (563550)
begin q:=cur←span;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12809 (557484)
else if width(info(q))<w then width(info(q)):=w
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-12964 (563934)
else if width(info(q))<w then width(info(q)):=w;
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12883 (560866)
depth(q):=0; glue←order(q):=normal; glue←sign(q):=normal; q:=p;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13039 (567395)
depth(q):=0; glue←order(q):=normal; glue←sign(q):=normal;
glue←stretch(q):=0; glue←shrink(q):=0; q:=p;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12920 (562438)
if mode=-hmode then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13077 (569007)
if mode=-vmode then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12949 (563469)
glue←set(q):=glue←set(p); shift←amount(q):=0;@/
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13106 (570038)
glue←set(q):=glue←set(p); {note that |shift←amount(q)| is already zero}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12956 (563693)
@ @<Set the glue in node |r|...@>=
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13113 (570286)
@ We insert a null kern node after a box made from spanned columns.
This prevents the user from getting at the dimensions of the box via
\.{\\unbox}, \.{\\unskip}, and \.{\\lastbox}. (Such dimensions depend on
floating-point rounding, so we must not let them be accessible.)
@↑unskip@>
@<Set the glue in node |r|...@>=
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-12967 (564050)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13129 (570932)
if span←count(r)>min←quarterword then {insert protective kern}
begin t:=new←kern(0); link(t):=link(r); link(r):=t; r:=t;
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13012 (565707)
if q<>null then tail:=q;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13179 (572793)
if p<>null then tail:=q;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13200 (575027)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13368 (582274)
@!print←head:pointer; {most recent node that has been printed}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13298 (580836)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13468 (588149)
print←nl("! Infinite glue shrinkage found in a paragraph");
@.Infinite glue shrinkage...@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13303 (581164)
print←nl("! Infinite glue shrinkage found in a paragraph"); error;
@.Infinite glue shrinkage...@>
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13475 (588572)
error;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13400 (586088)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13570 (593402)
@!artificial←badness:boolean; {has |b| been forced to zero?}
@!save←link:pointer; {temporarily holds value of |link(cur←p)|}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13639 (595932)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13812 (603391)
stat if tracing←stats>2 then
@<Print a symbolic description of the new break node@>;
tats@;@/
end
@ @<Print a symbolic description of the new break node@>=
begin print←nl("@@@@"); print←int(passive);
@.\at\at@>
print(": line "); print←int(line←number(q)-1);
print←char("."); print←int(fit←class);
if break←type=hyphenated then print←char("-");
print(" t="); print←int(total←demerits(q));
print(" ->"); print←int(prev←break(passive));
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13726 (599879)
begin if cur←active←width[1]<line←width then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13912 (607788)
begin stat artificial←badness:=false;@+tats@/
if cur←active←width[1]<line←width then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13780 (602238)
(prev←r=active) then b:=0 {set badness zero, this break is forced}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13967 (610188)
(prev←r=active) then
begin b:=0; {set badness zero, this break is forced}
stat artificial←badness:=true;@+tats
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13793 (602845)
@<Compute the fewest total demerits, |d|,
from the beginning to |cur←p| via@@|r|@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13983 (610853)
@<Compute the demerits, |d|, from |r| to |cur←p|@>;
stat if tracing←stats>2 then
@<Print a symbolic description of this feasible break@>;
tats@;@/
d:=d+total←demerits(r); {this is the minimum total demerits
from the beginning to |cur←p| via |r|}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13801 (603143)
@ @<Compute the fewest total demerits...@>=
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-13995 (611319)
@ @<Print a symbolic description of this feasible break@>=
begin if print←head<>cur←p then
@<Print the list between |print←head| and |cur←p|@>;
print←nl("@@");
@.\at@>
if cur←p=null then print←esc("par")
else if type(cur←p)<>glue←node then
begin if type(cur←p)=penalty←node then print←esc("penalty")
else if type(cur←p)=disc←node then print←esc("discretionary")
else if type(cur←p)=kern←node then print←esc("kern")
else print←esc("math");
end;
print(" via "); print←int(break←node(r)); print(" b=");
if artificial←badness then print←char("*")@+else print←int(b);
print(" p="); print←int(pi);
print(" d="); print←int(d);
end
@ @<Print the list between |print←head| and |cur←p|@>=
begin save←link:=link(cur←p); {this is OK even if |cur←p=null|}
link(cur←p):=null; print←nl(""); short←display(link(print←head));
link(cur←p):=save←link; print←head:=cur←p;
end
@ @<Compute the demerits, |d|, from |r| to |cur←p|@>=
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13808 (603339)
d:=d+total←demerits(r);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14026 (612419)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13889 (606699)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14106 (615748)
stat if tracing←stats>2 then
begin begin←diagnostic; print←nl("@@firstpass");@+end;@;@+tats@;@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13904 (607480)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14123 (616629)
stat if tracing←stats>2 then print←nl("@@secondpass");@;@+tats@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13907 (607580)
done:
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14127 (616797)
done: stat if tracing←stats>2 then end←diagnostic(true);@;@+tats@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13920 (608051)
passive:=null
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14140 (617329)
passive:=null; print←head:=temp←head; font←in←short←display:=undefined←font
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13951 (609117)
begin while is←char←node(cur←p) do
@<Advance \(c)|cur←p| to the node following the present character@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14171 (618457)
begin if is←char←node(cur←p) then
@<Advance \(c)|cur←p| to the node following the present
string of characters@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-13982 (610493)
@<Advance \(c)|cur←p| to the node following the present character@>=
begin f:=font(cur←p);
act←width:=act←width+char←width(f)(char←info(f)(character(cur←p)));
cur←p:=link(cur←p);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14203 (619856)
@<Advance \(c)|cur←p| to the node following the present string...@>=
begin prev←p:=cur←p;
repeat f:=font(cur←p);
act←width:=act←width+char←width(f)(char←info(f)(character(cur←p)));
cur←p:=link(cur←p);
until not is←char←node(cur←p);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-14082 (614353)
begin line←diff:=line←number(cur←p)-best←line;
if ((line←diff<actual←looseness)and(looseness<=line←diff))or@|
((line←diff>actual←looseness)and(looseness>=line←diff)) then
begin best←bet:=cur←p; actual←looseness:=line←diff;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14305 (623779)
begin line←diff:=line←number(r)-best←line;
if ((line←diff<actual←looseness)and(lπoseness<=line←diff))or@|
((line←diff>actual←looseness)and(looseness>=line←diff)) then
begin best←bet:=r; actual←looseness:=line←diff;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-14090 (614731)
begin best←bet:=cur←p; fewest←demerits:=total←demerits(r);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14313 (624149)
begin best←bet:=r; fewest←demerits:=total←demerits(r);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-14372 (627398)
@!hc:array[0..65] of ascii←code; {word to be hyphenated}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-14595 (636821)
@!hc:array[0..65] of halfword; {word to be hyphenated}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-14790 (645205)
hc[0]:=127; hc[hn+1]:=127; hc[hn+2]:=0; {insert delimiters}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-15013 (654600)
hc[0]:=127; hc[hn+1]:=127; hc[hn+2]:=256; {insert delimiters}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-15028 (654346)
@t\hskip1em@>@!trie←op←ptr:quarterword; {highest |trie←op| assigned}
tini
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-15252 (663744)
tini@;@/
@t\hskip1em@>@!trie←op←ptr:quarterword; {highest |trie←op| assigned}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-15643 (680243)
begin help2("The box you are trying to split is an \hbox.")@/
("I can't split such boxes, so I'll leave it alone.");
print←nl("! \vsplit needs a \vbox"); error; vsplit:=null; return;
@:vsplit←}{\.{\\vsplit needs a \\vbox}@>
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-15867 (689660)
begin print←nl("! \vsplit needs a \vbox");
@:vsplit←}{\.{\\vsplit needs a \\vbox}@>
help2("The box you are trying to split is an \hbox.")@/
("I can't split such a box, so I'll leave it alone.");
error; vsplit:=null; return;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16151 (703693)
if output←routine<>null then @<Fire up the user's output routine and |return|@>
else @<Perform the default output routine and |goto done|@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16376 (713120)
if output←routine<>null then
if dead←cycles>=max←dead←cycles then
@<Explain that too many dead cycles have occurred in a row@>
else @<Fire up the user's output routine and |return|@>;
@<Perform the default output routine and |goto done|@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16317 (709991)
@ @<Fire up the user's output routine and |return|@>=
begin output←active:=true;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16544 (719520)
@ @<Explain that too many dead cycles have occurred in a row@>=
begin print←nl("! \output loop---"); print←int(max←dead←cycles);
print(" consecutive dead cycles");
help3("I've concluded that your \output is awry; it never does a")@/
("\shipout, so I'm shipping \box255 out myself. Next time")@/
("increase \maxdeadcycles if you want me to be more patient."); error;
end
@ @<Fire up the user's output routine and |return|@>=
begin output←active:=true;
incr(dead←cycles);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16330 (710463)
begin end←graf; unsave; output←active:=false;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16566 (720391)
begin if loc<>null then confusion("output");
{output routine should just have ended}
end←token←list; {conserve stack space in case more outputs are triggered}
end←graf; unsave; output←active:=false;@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16450 (716216)
end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16689 (726304)
end←diagnostic(false);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16529 (719164)
end;
stat incr(dyn←used);@+tats@/
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16768 (729259)
stat incr(dyn←used);@+tats@/
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16582 (721109)
@ @<Make a ligature node,...@>=
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16821 (731206)
@ A discretionary break is not inserted for an explicit hyphen when we are
in restricted horizontal mode. In particular, this avoids putting
discretionary nodes inside of other discretionaries.
@↑explicit hyphens@>
@<Make a ligature node,...@>=
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16587 (721252)
if c="-" then tail←append(new←disc)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16831 (731568)
if c="-" then if mode=hmode then tail←append(new←disc)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16662 (724123)
vmode+stop: return; {this is the only way out}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16906 (734458)
vmode+stop: if its←all←over then return; {this is the only way out}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16672 (724590)
@ Either \.{\\dump} or \.{\\end} will cause |main←control| to exit,
since both of them have `|stop|' as their command code.
@<Put each...@>=
primitive("end",stop,0);@/
@!@:end←}{\.{\\end} primitive@>
primitive("dump",stop,1);@/
@!@:dump←}{\.{\\dump} primitive@>
@ @<Cases of |print←cmd←chr|...@>=
stop:if chr←code=1 then print←esc("dump")@+else print←esc("end");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16916 (734946)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16752 (727660)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-16984 (737638)
@ Either \.{\\dump} or \.{\\end} will cause |main←control| to enter the
endgame, since both of them have `|stop|' as their command code.
@<Put each...@>=
primitive("end",stop,0);@/
@!@:end←}{\.{\\end} primitive@>
primitive("dump",stop,1);@/
@!@:dump←}{\.{\\dump} primitive@>
@ @<Cases of |print←cmd←chr|...@>=
stop:if chr←code=1 then print←esc("dump")@+else print←esc("end");
@ We don't want to leave |main←control| immediately when a |stop| command
is sensed, because it may be necessary to invoke an \.{\\output} routine
several times before things really grind to a halt. (The output routine
might even say `\.{\\gdef\\end\{...\}}', to prolong the life of the job.)
Therefore |its←all←over| is |true| only when the current page
and contribution list are empty, and when the last output was not a
``dead cycle.'' However, 100 dead cycles in a row are considered to
be {\sl prima facie\/} evidence of a loop due to an improper output routine.
@ @<Declare act...@>=
function its←all←over:boolean; {do this when \.{\\end} or \.{\\dump} occurs}
label exit;
begin if privileged then
begin if (page←head=page←tail)and(head=tail)and@|
((dead←cycles=0)or(dead←cycles>=100)) then
begin if dead←cycles>0 then
begin@t@>@;@/
print←nl("(something on current page hasn't been shipped out)");
@.something on current...@>
end;
its←all←over:=true; return;
end;
back←input; {we will try to end again after ejecting residual material}
tail←append(new←null←box);
width(tail):=hsize;
tail←append(new←penalty(eject←penalty));@/
build←page; {append \.{\\hbox to \\the\\hsize\{\}\\penalty-10000}}
end;
its←all←over:=false;
exit:end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-16936 (735118)
@d special←group←end==special←control←sequence {permanent `\.{\\groupend}'}
@d special←right==special←control←sequence+1 {permanent `\.{\\right}'}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17211 (746804)
@d special←group←end==special←control←sequence+1 {permanent `\.{\\groupend}'}
@d special←right==special←control←sequence+2 {permanent `\.{\\right}'}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17450 (754455)
mark←ptr(p):=cur←val; link(tail):=p; tail:=p;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17725 (766127)
mark←ptr(p):=def←ref; link(tail):=p; tail:=p;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17463 (754795)
else if cur←chr=vmode then
begin scan←dimen(false,false,false); prev←depth:=cur←val;
end
else begin scan←int;
if (cur←val<0)or(cur←val>65536) then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17738 (766467)
else begin scan←optional←equals;
if cur←chr=vmode then
begin scan←normal←dimen; prev←depth:=cur←val;
end
else begin scan←int;
if (cur←val<=0)or(cur←val>65536) then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17477 (755163)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17752 (766876)
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17613 (759825)
begin link(tail):=p;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17890 (771549)
begin if (n>0)and(abs(mode)=mmode) then
begin print←nl("! Illegal math \discretionary");
help2("Sorry: The third part of a discretionary break must be")@/
("empty, in math formulas. I had to delete your third part.");
flush←node←list(p); n:=0; error;
end
else link(tail):=p;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17621 (760128)
tail:=q; decr(save←ptr); return;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17904 (772122)
if n>0 then tail:=q;
decr(save←ptr); return;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17633 (760523)
begin←diagnostic; show←box(p); end←diagnostic;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-17917 (772529)
begin←diagnostic; show←box(p); end←diagnostic(true);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17758 (765322)
help5("I can't figure out why you would want to use a tab mark or")@/
("\cr or \span just now. Perhaps you've inserted a right")@/
("brace that ended a previous alignment prematurely?")@/
("If so, you're probably due for more error messages, and you")@/
("might try typing `S' now just to see what is salvageable.");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18042 (777337)
if cur←tok=tab←token+"&" then
begin help6("I can't figure out why you would want to use a tab mark")@/
("here. If you just want an ampersand, the remedy is")@/
("simple: Just type `I\&' now. But if some right brace")@/
("up above has ended a previous alignment prematurely,")@/
("you're probably due for more error messages, and you")@/
("might try typing `S' now just to see what is salvageable.");
end
else begin help5("I can't figure out why you would want to use a tab mark")@/
("or \cr or \span just now. If something like a right brace")@/
("up above has ended a previous alignment prematurely,")@/
("you're probably due for more error messages, and you")@/
("might try typing `S' now just to see what is salvageable.");
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17855 (769082)
(font←params[fam←fnt(2+script←script←size)]<total←mathsy←params)or@|
(font←params[fam←fnt(3+text←size)]<total←mathex←params) then
begin print←nl("! Math mode disallowed: Insufficient symbol fonts");@/
@.Math mode disallowed...@>
help4("Sorry, but I can't go into math mode unless \textfont 2 and")@/
("\scriptfont 2 and \scriptscriptfont 2 have all the texinfo")@/
("needed in math symbol fonts, and unless \textfont 3 has")@/
("all the texinfo needed in a math extension font.");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18148 (781538)
(font←params[fam←fnt(2+script←script←size)]<total←mathsy←params) then
begin print←nl("! Math mode disallowed: Insufficient symbol fonts");@/
@.Math mode disallowed...@>
help3("Sorry, but I can't go into math mode unless \textfont 2 and")@/
("\scriptfont 2 and \scriptscriptfont 2 have all the texinfo")@/
("needed in math symbol fonts. You'd better start over.");
error; return;
end
else if (font←params[fam←fnt(3+text←size)]<total←mathex←params)or@|
(font←params[fam←fnt(3+script←size)]<total←mathex←params)or@|
(font←params[fam←fnt(3+script←script←size)]<total←mathex←params) then
begin print←nl("! Math mode disallowed: Insufficient extension fonts");@/
help3("Sorry, but I can't go into math mode unless \textfont 3 and")@/
("\scriptfont 3 and \scriptscriptfont 3 have all the texinfo")@/
("needed in math extension fonts. You'd better start over.");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-17912 (771435)
eq←word←define(glue←base+pre←display←size←code,w);
eq←word←define(glue←base+display←width←code,l);
eq←word←define(glue←base+display←indent←code,s);
if mode=vmode then build←page;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18212 (784287)
eq←word←define(dimen←base+pre←display←size←code,w);
eq←word←define(dimen←base+display←width←code,l);
eq←word←define(dimen←base+display←indent←code,s);
if nest←ptr=1 then build←page;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-18534 (793985)
mlist←to←hlist; p:=link(temp←head);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18834 (806824)
mlist←to←hlist;
@<Surround the hlist for the formula by \.{\\leftskip} and \.{\\rightskip};
let |p| point to the result@>;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-18562 (795011)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18864 (807949)
@ Now the hlist for the formula to be displayed begins at |link(temp←head)|.
@<Surround the hlist...@>=
if right←skip<>zero←glue then
begin p:=temp←head;
while link(p)<>null do p:=link(p);
link(p):=new←param←glue(right←skip←code);
end;
if left←skip=zero←glue then p:=link(temp←head)
else begin p:=new←param←glue(left←skip←code);
link(p):=link(temp←head);
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-18618 (797183)
begin p:=new←kern(z-w-e-d);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18933 (810508)
begin r:=new←kern(z-w-e-d);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-18651 (798332)
if q<>null then tail:=q;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18966 (811657)
if p<>null then tail:=q;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-18655 (798491)
if cur←group<>math←delim←group then confusion("dispalign");
@:confusion dispalign}{\quad dispalign@>
unsave;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-18970 (811816)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19060 (812675)
define(p,call+(a mod 4),cur←val);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19372 (825872)
define(p,call+(a mod 4),def←ref);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19104 (814003)
assign←toks: begin p:=cur←chr; scan←optional←equals; q:=scan←toks(false,false);
if link(cur←val)=null then define(p,undefined←cs,null)
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19417 (827228)
assign←toks: begin q:=cs←ptr;
p:=cur←chr; {|p=every←par←loc| or |output←routine←loc|}
scan←optional←equals;
cs←ptr:=q; q:=scan←toks(false,false);
if link(def←ref)=null then {empty list: revert to the default}
begin define(p,undefined←cs,null); free←avail(def←ref);
end
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19110 (814343)
link(q):=link(cur←val); link(cur←val):=q;
end;
define(p,call,cur←val);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19428 (827721)
link(q):=link(def←ref); link(def←ref):=q;
end;
define(p,call,def←ref);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19435 (826016)
begin scan←int;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19753 (839344)
begin if job←name=0 then open←log←file;
{avoid confusing \.{texput} with the font name}
scan←int;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19469 (827303)
if ((s=0)and font←scaled[f])or
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19789 (840705)
if ((s=0)and(font←size[f]<>font←dsize[f]))or
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19481 (827767)
if font←scaled[f] then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19801 (841183)
if font←size[f]<>font←dsize[f] then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19498 (828307)
((s=0)and not font←scaled[f])or((s<>0)and(s=font←size[f])) then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19818 (841736)
((s=0)and(font←size[f]=font←dsize[f]))or((s<>0)and(s=font←size[f])) then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19566 (830522)
token←show(cur←val); selector:=old←setting;
flush←list(cur←val);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19886 (843960)
token←show(def←ref); selector:=old←setting;
flush←list(def←ref);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19575 (830781)
begin if offset+length(s)>=max←print←line then print←ln
else if offset>0 then print←char(" ");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19895 (844219)
begin if term←offset+length(s)>=max←print←line-1 then print←ln
else if term←offset>0 then print←char(" ");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19621 (832419)
begin p:=scan←toks(false,false); p:=link(cur←val);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19941 (845869)
begin b:=cur←chr; p:=scan←toks(false,false); p:=link(def←ref);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19626 (832590)
ins←list(link(cur←val)); free←avail(cur←val); {omit reference count}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19946 (846052)
ins←list(link(def←ref)); free←avail(def←ref); {omit reference count}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19671 (834012)
else begin@t@>@;@/
help3("This isn't an error message; I'm just \showing something.")
@t\4@>@/
("Type `I\show...' to show more (e.g., \show\cs,")@/
("\showthe\count10, \showbox255, \showlists).");
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-19991 (847474)
else if tracing←online<>0 then
begin@t@>@;@/
help3("This isn't an error message; I'm just \showing something.")
@t\4\4@>@/
("Type `I\show...' to show more (e.g., \show\cs,")@/
("\showthe\count10, \showbox255, \showlists).");
end
else begin@t@>@;@/
help5("This isn't an error message; I'm just \showing something.")
@t\4\4@>@/
("Type `I\show...' to show more (e.g., \show\cs,")@/
("\showthe\count10, \showbox255, \showlists).")@/
("And type `I\tracingonline=1\show...' to show boxes and")@/
("lists on your terminal as well as on your log file.");
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19718 (835512)
begin scan←eight←bit←int;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20047 (849398)
begin scan←eight←bit←int; begin←diagnostic;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19722 (835670)
print←nl("! OK"); show←error;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20051 (849574)
end←diagnostic(true);
print←nl("! OK");
@↑OK@>
show←error;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-19731 (835914)
begin show←activities; print←nl("! OK"); show←error;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20063 (849850)
begin begin←diagnostic; show←activities; end←diagnostic(true);
print←nl("! OK");
show←error;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20079 (848048)
if font←scaled[k] then
begin dump←int(1);
end
else begin dump←int(0);
end;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20413 (862026)
dump←int(font←dsize[k]);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20101 (848645)
if font←scaled[k] then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20431 (862562)
if font←size[k]<>font←dsize[k] then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20108 (848885)
undump←qqqq(font←check[k]);
undump←int(font←size[k]);@/
undump←int(x);
if x=0 then font←scaled[k]:=false
else if x=1 then font←scaled[k]:=true
else goto bad←fmt;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20438 (862815)
undump←qqqq(font←check[k]);@/
undump←int(font←size[k]);
undump←int(font←dsize[k]);
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20275 (855501)
final←end:end.
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20602 (869349)
final←end: ready←already:=0;
end.
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20285 (855742)
begin@t@>@;@/
debug debug←help;@+gubed {the last chance to examine memory}
@<Finish the extensions@>;
stat if tracing←stats<>0 then @<Output statistics about this job@>;@;@+tats@/
@<Finish the \.{DVI} file@>;
if job←name>0 then
begin write←ln(err←file); a←close(err←file);
end;
end;
@ @<Output statistics...@>=
begin print←nl("Statistics for this run:"); print←ln;@/
print←int(str←ptr); print(" strings of total length "); print←int(pool←ptr);@/
print←nl("Maximum memory usage "); print←int(max←var←used);
print←char(","); print←int(mem←end+1-hi←mem←base);@/
print←ln; print←int(cs←count); print(" multiletter control sequences");@/
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20613 (869610)
begin @<Finish the extensions@>;
stat if tracing←stats>0 then @<Output statistics about this job@>;@;@+tats@/
@<Finish the \.{DVI} file@>;
if job←name>0 then
begin write←ln(log←file); a←close(log←file);
end;
end;
@ @d start←capacity←line==print←nl("...TeX capacity is currently ")
@<Output statistics...@>=
begin print←nl("Statistics for this run:"); print←ln;@/
@.Statistics for this run@>
print←int(str←ptr); print(" strings of total length "); print←int(pool←ptr);@/
start←capacity←line; print←int(max←strings); print←char(" ");
print←int(pool←size);@/
print←nl("Maximum memory usage "); print←int(max←var←used);
print←char("&"); print←int(mem←end+1-hi←mem←base);@/
start←capacity←line; print←int(hi←mem←base-mem←base); print←char("&");
print←int(mem←max+1-hi←mem←base);@/
print←ln; print←int(cs←count); print(" multiletter control sequences");@/
start←capacity←line; print←int(hash←size);@/
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20304 (856559)
print←ln; print←int(hyph←count); print(" hyphenation exception");
if hyph←count<>1 then print←char("s");
print←nl("Maximum stack usage "); print←int(max←in←stack);
print←char(","); print←int(max←nest←stack);
print←char(","); print←int(max←param←stack);
print←char(","); print←int(max←buf←stack+1);
print←char(","); print←int(max←save←stack+6);
end
@ We get to the |final←cleanup| routine when \.{\\end} or \.{\\dump} has
been scanned.
@<Last-minute...@>=
procedure final←cleanup;
label done,exit;
var c:small←number; {0 for \.{\\end}, 1 for \.{\\dump}}
@!k:small←number; {the number of times we tried to eject a page}
begin c:=cur←chr;
if job←name=0 then open←err←file;
@<Eject the remaining page(s)@>;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20638 (870696)
start←capacity←line; print←int(font←mem←size); print←char(" ");
print←int(font←max-font←base);@/
print←ln; print←int(hyph←count); print(" hyphenation exception");
if hyph←count<>1 then print←char("s");
start←capacity←line; print←int(hyph←size);@/
print←nl("Maximum stack usage "); print←int(max←in←stack);
print("i,"); print←int(max←nest←stack);
print("n,"); print←int(max←param←stack);
print("p,"); print←int(max←buf←stack+1);
print("b,"); print←int(max←save←stack+6); print←char("s");@/
start←capacity←line; print←int(stack←size);
print("i,"); print←int(nest←size);
print("n,"); print←int(param←size);
print("p,"); print←int(buf←size);
print("b,"); print←int(save←size); print←char("s");
end
@ We get to the |final←cleanup| routine when \.{\\end} or \.{\\dump} has
been scanned and |its←all←over|.
@<Last-minute...@>=
procedure final←cleanup;
label exit;
var c:small←number; {0 for \.{\\end}, 1 for \.{\\dump}}
@!k:small←number; {the number of times we tried to eject a page}
@!t:integer; {value of |total←pages| before trying |build←page|}
begin c:=cur←chr;
if job←name=0 then open←log←file;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20336 (857647)
@ The following loop is performed after |main←control| has completed its
activity, but its actions are like those done in |main←control|.
@<Eject the remaining page(s)@>=
k:=0;
loop@+ begin build←page; {empty the contribution list}
if page←head=page←tail then goto done;
tail←append(new←null←box);
width(tail):=hsize;
tail←append(new←penalty(eject←penalty));
incr(k);
if k>25 then
begin@t@>@;@/
print←nl("(something on current page hasn't been shipped out)");
@.something on current...@>
goto done;
end;
end;
done:
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20678 (872184)
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20373 (858765)
if format←ident=0 then
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20695 (872734)
if (format←ident=0)or(buffer[loc]="!") then
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20601 (868296)
cs←ptr:=k; p:=scan←toks(false,false); send←tokens(tail):=cur←val;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20925 (882379)
cs←ptr:=k; p:=scan←toks(false,false); send←tokens(tail):=def←ref;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20611 (868583)
@ @<Implement \.{\\xsend}@>=
begin new←whatsit(xsend←node,send←node←size); send←stream(tail):=0;
p:=scan←toks(false,true); send←tokens(tail):=cur←val;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-20935 (882666)
@<Implement \.{\\xsend}@>=
begin new←whatsit(xsend←node,send←node←size); send←stream(tail):=0;
p:=scan←toks(false,true); send←tokens(tail):=def←ref;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20696 (871395)
show←token←list(link(send←tokens(p)),null,300); selector:=old←setting;
str←room(1);
if cur←length>255 then
begin print←nl("\xsend has been truncated to 255 characters!");
@:xsend←}{\.{\\xsend has been truncated...}@>
pool←ptr:=str←start[str←ptr]+255;
begin←diagnostic; print←current←string; end←diagnostic;
end;
dvi←out(xxx); dvi←out(cur←length);
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-21020 (885492)
show←token←list(link(send←tokens(p)),null,pool←size-pool←ptr);
selector:=old←setting;
str←room(1);
if cur←length<256 then
begin dvi←out(xxx1); dvi←out(cur←length);
end
else begin dvi←out(xxx4); dvi←four(cur←length);
end;
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20717 (872363)
@d special←send==special←control←sequence+2
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-21040 (886332)
@d special←send==special←control←sequence+3 { `\.{\\endsend}' }
@.endsend@>
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20726 (872723)
@!old←mode,@!old←offset:integer; {saved values}
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-21050 (886725)
@!old←mode:integer; {saved |mode|}
***************
**** FILE PS:<TEX.WEB>TEX.WEB.1, 1-20730 (872915)
and make |link(cur←val)| point to the result@>;
old←setting:=selector; old←offset:=offset; j:=send←stream(p);
if send←open[j] then selector:=j
else print←nl(""); {send to the terminal if file isn't open}
show←token←list(link(cur←val),null,buf←size-10); print←ln;
flush←list(cur←val); selector:=old←setting;
if send←open[j] then offset:=old←offset;
**** FILE PS:<1SCRATCH>TEX.WEB.1, 1-21054 (886904)
and make |link(def←ref)| point to the result@>;
old←setting:=selector; j:=send←stream(p);
if send←open[j] then selector:=j
else print←nl(""); {send to the terminal if file isn't open}
show←token←list(link(def←ref),null,buf←size-10); print←ln;
flush←list(def←ref); selector:=old←setting;
***************
Here is TEX.WEB:
% This program is copyright 1982 by D. E. Knuth; all rights are reserved.
% Please don't make any changes to this file unless you are D. E. Knuth!
% Version 0 is fully implemented but not yet fully tested, so beware of bugs.
% Here is TeX material that gets inserted after \input webhdr
\def\hang{\hangindent 3em\ \unskip\!}
\def\textindent#1{\hangindent 2.5em\noindent\hbox to 2.5em{\hss#1 }\!}
\def\at{@@} % use for an at sign
\chcode@@=13 \def@@{\penalty999\ } % ties words together
\def\TeX{T\hbox{\hskip-.1667em\lower.424ex\hbox{E}\hskip-.125em X}}
\font b=cmr9 \def\mc{\:b} % medium caps for names like PASCAL
\def\PASCAL{{\mc PASCAL}}
\def\ph{{\mc PASCAL-H}}
\font L=manfnt % font used for the METAFONT logo
\def\MF{{\:L META}\-{\:L FONT}}
\def\<#1>{$\langle#1\rangle$}
\def\kern{\penalty100000\hskip}
\def\(#1){} % this is used to make module names sort themselves better
\def\9#1{} % this is used for sort keys in the index via @@:sort key}{entry@@>